package com.wanmait.hr.controller;

import com.wanmait.hr.service.PictureService;
import com.wanmait.hr.util.FileUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/manage/addStaff")
public class PictureController {
@Resource
private PictureService pictureService;
    @RequestMapping("addPic")
public void addPic()//去添加页面
{

}
@RequestMapping("showPic")
public ModelAndView showPic(MultipartFile photo, HttpServletRequest request, FileUtils fileUtils)//显示图片
{
    String newName=pictureService.showPic(photo, request, fileUtils);
    ModelAndView mv=new ModelAndView();
    mv.addObject("newName",newName);
    return  mv;
}
}
